﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using SQLServerHealthCheck.SQLServer;
using System.Configuration;

namespace SQLServerHealthCheck.PL
{
    public partial class OverviewSQLAgentJobs : Form
    {
        HealthCheckControlPanel hccp;
        public OverviewSQLAgentJobs(HealthCheckControlPanel controlPanel)
        {
            hccp = controlPanel;
            InitializeComponent();
        }

        private void SQLAgentJobResults_Load(object sender, EventArgs e)
        {
            try
            {
                // TODO: This line of code loads data into the 'DataSetSQLAgentJobResults.DataTableSQLAgentJobDetails' table. You can move, or remove it, as needed.
                this.TableAdapterSQLAgentJobDetails.Connection.ConnectionString = ConfigurationManager.AppSettings["ConnectionStringSSHCDatabase"];
                this.TableAdapterSQLAgentJobDetails.Fill(this.DataSetSQLAgentJobResults.DataTableSQLAgentJobDetails);
                rvPerformanceSQLAgentJobDetails.LocalReport.ReportPath = System.Windows.Forms.Application.StartupPath + @"\Reports\SQLAgentJobReports.rdlc";
                this.WindowState = FormWindowState.Maximized;
                this.rvPerformanceSQLAgentJobDetails.RefreshReport();
            }
            catch (Exception ex)
            {

                //InstallationCheck.WriteExceptioninFile("Form:SQLAgentJobResults  Method: SQLAgentJobResults_Load " + ex.Message.ToString());

                MessageBox.Show(ex.Message, "HealthCheck", MessageBoxButtons.OK, MessageBoxIcon.Error);         

            }
        }
    }
}
